using System;
using Newtonsoft.Json;

namespace FBGraph.Models
{
    /// <summary>A Facebook note</summary>
    /// <remarks>
    /// <para>Example: https://graph.facebook.com/122788341354 (The note announcing Facebook for iPhone 3.0)</para>
    /// </remarks>
    public partial class Note : IFBGraphResult
    {
        /// <summary>The note ID</summary>
        [JsonPropertyAttribute("id")]
        public Int64 Id { get; set; }
        
        /// <summary>The ID of the user who posted the note</summary>
        [JsonPropertyAttribute("from")]
        public From From { get; set; }
        
        /// <summary>The title of the note</summary>
        [JsonPropertyAttribute("subject")]
        public String Subject { get; set; }
        
        /// <summary>The note content, an HTML string</summary>
        [JsonPropertyAttribute("message")]
        public String Message { get; set; }
        
        /// <summary>A URL for an icon representing the note</summary><remarks>The icon appears to be 16x16 or smaller, similar to a favicon.</remarks>
        [JsonPropertyAttribute("icon")]
        public String Icon { get; set; }
        
        /// <summary>The time the note was initially published</summary>
        [JsonPropertyAttribute("created_time")]
        public DateTime CreatedTime { get; set; }
        
        /// <summary>The time the note was last updated</summary>
        [JsonPropertyAttribute("updated_time")]
        public DateTime UpdatedTime { get; set; }
        
        /// <summary>Gets or sets a <see cref="Boolean" /> value representing whether the object has been populated.</summary>
        Boolean IFBGraphResult.IsReady { get; set; }
        /// <summary>Updates the current model with values from another like-typed model.</summary>
        /// <param name="other">The source model.</param>
        /// <remarks>This is used for asynchronous calls to update the reference that was returned when the original API method was called.</remarks>
        void IFBGraphResult.UpdateFrom(IFBGraphResult other)
        {
            var that = other as Note;
            if (that == null) return;
            else
            {
                this.Id = that.Id;
                this.From = that.From;
                this.Subject = that.Subject;
                this.Message = that.Message;
                this.Icon = that.Icon;
                this.CreatedTime = that.CreatedTime;
                this.UpdatedTime = that.UpdatedTime;
                ((IFBGraphResult)this).IsReady = true;
            }
            
        }
    }
}